import { S } from '../../s';
import { IPSDEWizard } from './ipsdewizard';
import { IPSDEWizardForm } from './ipsdewizard-form';
import { IPSDEWizardStep } from './ipsdewizard-step';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEWizardFormImpl
  extends PSModelObjectImpl
  implements IPSDEWizardForm
{
  protected cm2pslanguageres: IPSLanguageRes;
  getCM2PSLanguageRes(): IPSLanguageRes | null {
    return (
      this.cm2pslanguageres ||
      (this.cm2pslanguageres = this.fillObjectModel(
        S._276,
        this.M.getCM2PSLanguageRes,
        S._32e,
      ) as IPSLanguageRes)
    );
  }

  protected cmpslanguageres: IPSLanguageRes;
  getCMPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.cmpslanguageres ||
      (this.cmpslanguageres = this.fillObjectModel(
        S._276,
        this.M.getCMPSLanguageRes,
        S._32f,
      ) as IPSLanguageRes)
    );
  }

  get confirmMsg(): string {
    return this.M.confirmMsg;
  }

  get confirmMsg2(): string {
    return this.M.confirmMsg2;
  }

  get formTag(): string {
    return this.M.formTag;
  }

  getPSDEFormName(): string {
    return this.M.getPSDEFormName;
  }

  protected psdewizardstep: IPSDEWizardStep;
  getPSDEWizardStep(): IPSDEWizardStep | null {
    if (this.psdewizardstep != null) return this.psdewizardstep;
    const value = this.M.getPSDEWizardStep;
    if (value == null) {
      return;
    }
    const ipsdewizard = this.getParentPSModelObject(S._212) as IPSDEWizard;
    if (ipsdewizard != null) {
      this.psdewizardstep = ipsdewizard.findPSDEWizardStep(value);
    }
    return this.psdewizardstep;
  }
  protected stepactions: string[];
  getStepActions(): string[] | null {
    if (this.stepactions == null) {
      const value = this.M.stepActions;
      if (value == null) {
        return null;
      }
      const arrayNode: any[] = value;
      if (arrayNode.length == 0) {
        return null;
      }
      const list: string[] = [];
      for (let i = 0; i < arrayNode.length; i++) {
        list.push(arrayNode[i]);
      }
      this.stepactions = list;
    }
    return this.stepactions;
  }

  get firstForm(): boolean {
    return this.M.firstForm;
  }
  get cls(): string {
    return 'PSDEWizardFormImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._211) return true;
    return super.instanceof(cls);
  }
}
